﻿@model MAY.CHANEL.ViewModel.TeacherEditViewModel

@{
    ViewBag.Title = "TeacherEdit";
}

<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>课程管理--厚溥学生学籍管理系统</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="format-detection" content="telephone=no">
    <link rel="stylesheet" href="/layui/css/layui.css" media="all" />
    <link rel="stylesheet" href="~/Content/font_eolqem241z66flxr.css" media="all" />
    <link rel="stylesheet" href="~/Content/user.css" media="all" />
</head>
<body class="childrenBody">
    <fieldset class="layui-elem-field layui-field-title" style="margin-top: 50px;">
        <legend>编辑老师信息</legend>
    </fieldset>
    <form class="layui-form" action="" lay-filter="example">
        @Html.HiddenFor(model => model.TeaId)
        <div class="layui-form-item">
            <label class="layui-form-label">姓名</label>
            <div class="layui-input-block">
                @Html.TextBoxFor(model => model.TeaName, new { @class = "layui-input", lay_verify = "required", autocomplete = "off", placeholder = "请输入姓名" })
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">年龄</label>
            <div class="layui-input-block">
                @Html.TextBoxFor(model => model.TeaAge, new { @class = "layui-input", lay_verify = "required", autocomplete = "off", placeholder = "请输入年龄" })
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">班级</label>
            <div class="layui-input-block">
                @Html.DropDownListFor(model => model.ClassId, ViewData["List"] as IEnumerable<SelectListItem>, new { lay_filter = "aihao" })
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">单选框</label>
            <div class="layui-input-block">
                @Html.RadioButtonFor(model => model.TeaSex, true, new { title = "女" })
                @Html.RadioButtonFor(model => model.TeaSex, false, new { title = "男" })
            </div>
        </div>

        <div class="layui-form-item">
            <div class="layui-input-block">
                <button class="layui-btn" lay-submit="" lay-filter="demo1">立即提交</button>
            </div>
        </div>
    </form>
    <div id="page"></div>
    <script src="/layui/layui.js"></script>
    <script>
        var $;
        layui.use(['form','jquery'], function () {
            var form = layui.form; //获取form模块
            //获取upload模块
            $ = layui.jquery;
            form.on('submit(demo1)', function (data) {
                //layer.alert(JSON.stringify(data.field),
                //title: '最终的提交信息'
                $.post('@Url.Action("TeacherEdit","Stu")', data.field, function (data) {
                    if (data.State == 1) {
                        //1.提示成功
                        layer.open({
                            title: '温馨提示',
                            content: data.Message,
                            yes: function (index, layero) {
                                //2.关闭提示窗口
                                layer.close(index);
                                //3.关闭添加窗口
                                layer.close("iframe")
                                //4.刷新页面
                                parent.location.reload();
                            }
                        })
                    }
                }, "json")
                return false;
            })
        })
    </script>
</body>
</html>
